package consul;

import com.google.gson.Gson;
import consul.allinone.RpcURL;
import consul.allinone.regist.ConsulRegistService;

import java.io.IOException;

/**
 * Title:
 * Description:
 * Author:吉
 * Since:2018/4/13
 * Version:1.1.0
 */
public class MainRegister {

    public static void main(String[] args) throws IOException {
        ConsulRegistService consulRegist = new ConsulRegistService("192.168.56.200", 8500);
        RpcURL url = new RpcURL("192.168.20.236", 8080);
        url.setId("spjich_id");
        url.setServiceName("mockNotice");
        RpcURL url2 = new RpcURL("192.168.20.236", 8080);
        url2.setId("spjich_id2");
        url2.setServiceName("mockNotice");
        consulRegist.register(url);
        System.out.println("注册.." + url.getId());
        consulRegist.register(url2);
        System.out.println("注册.." + url2.getId());
    }
}
